//
//  OperationTotalCell.m
//  MonitoringNetwork
//
//  Created by admin on 2017/12/22.
//  Copyright © 2017年 wtmcxlm. All rights reserved.
//

#import "OperationTotalCell.h"


@interface OperationTotalCell()
@property (nonatomic,strong)UILabel *totalLabel;
@end
@implementation OperationTotalCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
//        [self setUpUI];
    }
    return self;
}
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self setUpUI];
    }
    return self;
}

- (void)setUpUI
{
    UIView *backView = [UIView new];
    backView.backgroundColor = [UIColor colorWithRed:0.97f green:0.97f blue:0.97f alpha:1.00f];
    [self addSubview:backView];
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.top.mas_equalTo(self);
        make.height.mas_equalTo(11);
    }];
    UILabel *label1 = [UILabel LabelWithFont:TitleLagerFontSize andColor:TitleColor andTextAlignment:left andString:@"车辆总数"];
    [self addSubview:label1];
    [label1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(33);
        make.centerY.mas_equalTo(self.mas_centerY).offset(5);
    }];
    self.totalLabel = [UILabel LabelWithFont:MaxFontSize andColor:NumColor andTextAlignment:left andString:@"0"];
    [self addSubview:_totalLabel];
    [_totalLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_centerX).offset(0);
        make.centerY.mas_equalTo(self.mas_centerY).offset(5);
    }];
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    if (_total) {
        _totalLabel.text = [NSString separatedDigitStringWithStr:_total];
    }
}
@end
